package com.atguigu.day17.exer;

import org.junit.Test;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.Random;

public class Exer01<c1> {
    @Test
    public void exer1() {
        Collection c1 = new ArrayList();
        for (int i = 0; i <= 100; i++) {
            c1.add(i);
        }
        for (Object o : c1) {
            System.out.println(o);
        }
        Iterator iterator = c1.iterator();
        while (iterator.hasNext()) {
            Integer i1 = (Integer) iterator.next();
            if (i1 % 10 == 3) {
                iterator.remove();
            }
        }
        for (Object o : c1) {
            System.out.println(o);
        }
        c1.remove(11);
        for (Object o : c1) {
            System.out.println(o);
        }
        Collection c2=new ArrayList();
        Random random=new Random();
        for (int i=1;i<=10;i++){
            c2.add(random.nextInt(100));
        }
    }
}
